// 默认导出
export default function formatDate(date) {
  return new Date(date).toLocaleDateString('zh-CN')
}

// 命名导出
export function formatCurrency(amount) {
  return new Intl.NumberFormat('zh-CN', {
    style: 'currency',
    currency: 'CNY'
  }).format(amount)
}

export function formatPhoneNumber(phone) {
  return phone.replace(/(\d{3})(\d{4})(\d{4})/, '$1-$2-$3')
}

// 导出常量
export const APP_NAME = 'React 导入导出示例'
export const VERSION = '1.0.0'

// 导出对象
export const config = {
  apiUrl: 'https://api.example.com',
  timeout: 5000,
  retries: 3
}

// 导出类
export class Calculator {
  add(a, b) {
    return a + b
  }
  
  subtract(a, b) {
    return a - b
  }
  
  multiply(a, b) {
    return a * b
  }
  
  divide(a, b) {
    return a / b
  }
} 